package com.px.tc_ip;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Scanner;

public class ServerTest {
    public static void main(String[] args) {
        try {


                ServerSocket serverSocket=new ServerSocket(1235);
                System.out.println("成功启动");
                Socket income=serverSocket.accept();


                InputStream ir=income.getInputStream();
                Scanner scanner=new Scanner(ir,"UTF-8");

                String  aa=scanner.nextLine();
                System.out.println(aa);
                scanner.hasNextLine();
                String aaaa=scanner.nextLine();
                System.out.println(aaaa);


           /* InputStreamReader rr=new InputStreamReader(ir,"UTF-8");

            int len;
            while ((len=rr.read())!=-1){
                System.out.print((char)len);
            }*/

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
